/************************************************************************/
/*    Author: Scott Bevin									            */
/************************************************************************/


#pragma once

#include <Ogre.h>
#include "..\XMessaging\Messenger.h"
#include "..\XEntityComponents\ComponentContainer.h"
#include "..\XPropertys\PropertyContainer.h"
#include "..\XInput\Input.h"

namespace XF
{
	class GameEntity :
		public Messenger, public ComponentContainer, public PropertyContainer
	{
	private:
		bool mInitialized;
		bool mDead;
		bool mShutdown;
	public:
		GameEntity();
		GameEntity(GameEntity &copy);
		~GameEntity();

		void Update(double dT);
		void Initialize();
		void HandleInput(double dT, XF::Input* input);
		bool OnHandleMessage(const XF::Message& message);
		void Shutdown();


		void ClearEntity(){ClearComponents(); ClearPropertys();}
		void ClearComponents();
		void ClearPropertys(){ RemoveAllProperties(); }

		void IntegrateEntity(GameEntity *ent);
		void CopyEntity(GameEntity *ent);

		bool IsInitialized(){return mInitialized;}

		void Kill()
		{
			if(!mDead)
				PostAMessage(ID(), XF::MessageSubject::DIED);
			mDead = true;
		};
		bool IsDead(){return mDead;}
	};
}
